package io.renren.modules.sell.entity;/**
 * @auther MR.M
 * @date 2019/5/3-16:00
 */

import cn.hutool.core.util.EnumUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonIgnore;

import io.renren.modules.sell.enums.OrderStatusEnum;
import io.renren.modules.sell.enums.PayStatusEnum;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 *@ClassName OrderMadter
 *@Descripyion TODO
 *@Author mengjiafeng
 *@Date 2019/5/3 16:00
 *@Version 1.0
 **/
@Data
public class OrderMaster {
    @TableId
    private String orderId;
    private String buyerName;
    private String buyerPhone;
    private String buyerAddress;
    private Long userId;
    //买家微信OpenId
    private String buyerOpenId;
    //订单总金额
    private BigDecimal orderAmount;
    //订单状态，默认为0新订单
    private Integer orderStatus= OrderStatusEnum.NEW.getCode();
    //支付状态
    private Integer payStatus= PayStatusEnum.WAIT.getCode();
    private Date createTime;
    @TableField(update = "now()")
    private Date updateTime;
//    @JsonIgnore
//    public OrderStatusEnum getOrderStatusEnum(){
//        return EnumUtil.getByCode(orderStatus,OrderStatusEnum.class);
//    }
//    @JsonIgnore
//    public PayStatusEnum getPayStatusEnum(){
//        return EnumUtil.getByCode(payStatus,PayStatusEnum.class);
//
//    }
}
